# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=protos-sip
pkgver=2
pkgrel=5
pkgdesc='SIP test suite.'
groups=('blackarch' 'blackarch-voip')
arch=('x86_64' 'aarch64')
url='https://www.ee.oulu.fi/research/ouspg/PROTOS_Test-Suite_c07-sip'
license=('GPL2')
depends=('java-runtime-headless')
noextract=('c07-sip-r2.jar')
source=("c07-sip-r2.jar::https://www.ee.oulu.fi/research/ouspg/PROTOS_Test-Suite_c07-sip?action=AttachFile&do=get&target=c07-sip-r2.jar")
sha512sums=('4ec17fb768039b899f8368eb36b90c0c5603e76301e4fff06d77196d9367b2cc70c52e7047f69cc6578187a8682a7f57d87e7c48018c782da552aaf11768dfa6')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 c07-sip-r2.jar "$pkgdir/usr/share/$pkgname/c07-sip-r2.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec java -jar c07-sip-r2.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

